package DesignPattern.Structure.Combination;

public class Client {
    public static void main(String[] args) {
        MenuComponent menu1 = new Menu("菜单管理", 2);
        for (String item : new String[]{"页面访问", "展开菜单", "编辑菜单", "删除菜单", "新增菜单"}) {
            menu1.add(new MenuItem(item, 3));
        }
        MenuComponent menu2 = new Menu("权限管理", 2);
        for (String item : new String[]{"页面访问", "提交保存"}) {
            menu2.add(new MenuItem(item, 3));
        }
        MenuComponent menu3 = new Menu("角色管理", 2);
        for (String item : new String[]{"页面访问", "新增角色", "修改角色"}) {
            menu3.add(new MenuItem(item, 3));
        }
        MenuComponent component = new Menu("系统管理", 1);
        component.add(menu1);
        component.add(menu2);
        component.add(menu3);

        component.print();
    }
}
